package com.wx.day05.Annotation_aop.test2.Work.Controller;

import com.wx.day05.Annotation_aop.test2.Work.Service.StudentService;
import com.wx.day05.Annotation_aop.test2.Work.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.List;

@Controller
public class StudentController {
    @Autowired
    private StudentService studentService;

    public void httpStudentAll() throws Exception {
        List<Student> studentList = studentService.getStudentList();
        for (Student student : studentList) {
            System.out.println(student);
        }
    }

    public void httpInsertStudent() throws Exception {
        studentService.addStudent();
    }

    public void httpUpdateStudent(Integer id) throws Exception {
        studentService.deleteStudent(id);
    }

    public void httpDeleteStudent(Integer id) throws Exception {
        studentService.deleteStudent(id);
    }
}
